package com.wenlin.customerservice.client;

import com.wenlin.customerservice.response.Message;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import static org.springframework.web.bind.annotation.RequestMethod.GET;

/***
 *  Created with IntelliJ IDEA.
 *  User:  wenlin
 *  Date:  2017/11/24
 *  Time:  8:54
 *  Description:
 **/
@FeignClient(name="user-service",fallback = UserClientHystrix.class)
@Component
public interface UserClient {
    /***
     *  User:  wenlin
     *  Date:  2017/11/24
     *  Time:  9:01
     *  Description:feign调用用户信息接口
     **/
    @RequestMapping(value="/user/base/info",method = GET)
    Message getUser(@RequestParam("id") Integer id);

    @RequestMapping(value="/user/redis/annation",method = GET)
    String getLock();


    @RequestMapping(value="/user/redis/fairLock",method = GET)
    Message<Boolean> getFairLock();
}
